using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.Sec_Syslog;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
using BussinessObjects;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_Sec_Syslog
    {
        public static DataTable SelectAll(int status)
        {
            try
            {
                BOSec_Syslog_Select_All action = new BOSec_Syslog_Select_All();
                usp_Sec_Syslog_Select_All entity = new usp_Sec_Syslog_Select_All();
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status)
        {
            try
            {
                BOSec_Syslog_Select_Top action = new BOSec_Syslog_Select_Top();
                usp_Sec_Syslog_Select_Top entity = new usp_Sec_Syslog_Select_Top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable Search(int log_id)
        {
            try
            {
                BOSec_Syslog_Search action = new BOSec_Syslog_Search();
                usp_Sec_Syslog_Search entity = new usp_Sec_Syslog_Search();
                entity.LOG_ID = log_id;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool DelAll()
        {
            try
            {
                BOSec_Syslog_Del_All action = new BOSec_Syslog_Del_All();
                usp_Sec_Syslog_Del_All entity = new usp_Sec_Syslog_Del_All();
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
        {
            try
            {
                BOSec_Syslog_Select_WithPaged action = new BOSec_Syslog_Select_WithPaged();
                usp_Sec_Syslog_Select_WithPaged entity = new usp_Sec_Syslog_Select_WithPaged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectGetAll(int startIndex, int pageCount, int status)
        {
            try
            {
                BOSec_Syslog_GetAll action = new BOSec_Syslog_GetAll();
                usp_Sec_Syslog_GetAll entity = new usp_Sec_Syslog_GetAll();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(int ADMIN_MODULE_ID, int ADMIN_ID, string ip_address, DateTime ACCESS_DATE, bool STATUS)
        {
            try
            {
                BOSec_Syslog_Insert action = new BOSec_Syslog_Insert();
                usp_Sec_Syslog_Insert entity = new usp_Sec_Syslog_Insert();
                entity.ADMIN_MODULE_ID = ADMIN_MODULE_ID;
                entity.ADMIN_ID = ADMIN_ID;
                entity.ACCESS_DATE = ACCESS_DATE;
                entity.STATUS = STATUS;
                entity.IP_ADDRESS = ip_address;

                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update(Int64 LOG_ID, int ADMIN_MODULE_ID, int ADMIN_ID, DateTime ACCESS_DATE, bool STATUS)
        {
            try
            {
                BOSec_Syslog_Update action = new BOSec_Syslog_Update();
                usp_Sec_Syslog_Update entity = new usp_Sec_Syslog_Update();
                entity.LOG_ID = LOG_ID;
                entity.ADMIN_MODULE_ID = ADMIN_MODULE_ID;
                entity.ADMIN_ID = ADMIN_ID;
                entity.ACCESS_DATE = ACCESS_DATE;
                entity.STATUS = STATUS;

                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int log_id)
        {
            try
            {
                BOSec_Syslog_Delete action = new BOSec_Syslog_Delete();
                usp_Sec_Syslog_Delete entity = new usp_Sec_Syslog_Delete();
                entity.LOG_ID = log_id;

                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Restore(int log_id)
        {
            try
            {
                BOSec_Syslog_Restore action = new BOSec_Syslog_Restore();
                usp_Sec_Syslog_Restore entity = new usp_Sec_Syslog_Restore();
                entity.LOG_ID = log_id;

                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

